package com.ying.consumer10001.controller;

import com.ying.consumer10001.domain.DoMain;
import com.ying.consumer10001.fegin.Provider9001Fegin;
import com.ying.consumer10001.pack.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/prov")
public class Consumer10001Controller {

    @Autowired
    Provider9001Fegin provider9001Fegin;

    @GetMapping("/get/{id}")
    public R getdomain(@PathVariable Long id) {
        return provider9001Fegin.getdomain(id);
    }

    @GetMapping("/delete/{id}")
    public R deletedomain(@PathVariable Long id) {
        return provider9001Fegin.deletedomain(id);
    }

    @PostMapping("/insert")
    public R insertdomain(DoMain doMain) {
        System.out.println(doMain);
        return provider9001Fegin.insertdomain(doMain);
    }

    @PostMapping("/update")
    public R updatedomain(DoMain doMain) {
        System.out.println(doMain);
        return provider9001Fegin.updatedomain(doMain);
    }

}
